<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css">
    <script src="../node_modules/jquery/dist/jquery.js"></script>
    <script src="../node_modules/bootstrap/dist/js/bootstrap.js"></script>
    <link rel="stylesheet" href="../css/book.css">
</head>
<body class="container-fluid">
<div id="div1">
    <button type="button" class="btn btn-success" data-toggle="modal" data-target="#addModal">添加</button>
</div>
<table class="table table-striped">
    <thead>
    <tr>
        <td>bname</td>
        <td>price</td>
        <td>author</td>
        <td>pressDate</td>
        <td>operation</td>
    </tr>
    </thead>
    <tbody id="tbody">
        <tr id="tr-temp" style="display:none">
            <td class="name"></td>
            <td class="price"></td>
            <td class="author"></td>
            <td class="pressDate"></td>
            <td class="operation"><button class="btn btn-danger">删除</button></td>
        </tr>
    </tbody>
</table>
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="myModalLabel">添加</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form id="addForm">
                    <div class="form-group">
                        <label for="bName">书名</label>
                        <input type="text" required class="form-control" id="bName" placeholder="书名">
                    </div>
                    <div class="form-group">
                        <label for="price">价格</label>
                        <input type="number" required class="form-control" id="price" placeholder="价格">
                    </div>
                    <div class="form-group">
                        <label for="author">作者</label>
                        <input type="text" required class="form-control" id="author" placeholder="作者">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary addBtn" data-dismiss="modal">保存</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="updateModalLabel">更新</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="ubName">书名</label>
                        <input type="text" required class="form-control" id="ubName" placeholder="书名">
                    </div>
                    <div class="form-group">
                        <label for="uprice">价格</label>
                        <input type="number" required class="form-control" id="uprice" placeholder="价格">
                    </div>
                    <div class="form-group">
                        <label for="uauthor">作者</label>
                        <input type="text" required class="form-control" id="uauthor" placeholder="作者">
                    </div>
                    <input hidden type="text" id="id">
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary updateBtn" data-dismiss="modal">更新</button>
            </div>
        </div>
    </div>
</div>

<script src="../js/time.js"></script>
<script src="../js/myAjax.js"></script>
<script src="../js/book.js"></script>
</body>
</html>